package fr.cephb.j2ee.tag;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.BodyTagSupport;

/**
 * 
 * AbstractContentTag
 *
 */
public abstract class AbstractContentTag
extends BodyTagSupport
	{
	private static final long serialVersionUID = 1L;
	
	/***
	 * SVGTitle
	 */
	protected AbstractContentTag()
	        {
	
	        }
	
	@Override
	public int doStartTag() throws JspException
	        {
	        return EVAL_BODY_BUFFERED;
	        }
	
	@Override
	public int doEndTag() throws JspException {
	        try {
	                String content= null;
	                if(this.bodyContent!=null)
	                        {
	                        content= this.bodyContent.getString();
	                        }
	                if(content!=null )
	                        {
	                        print(super.pageContext.getOut(),content);
	                        }
	                }
	        catch (IOException err)
	                {
	                throw new JspException(err);
	                }
	        return EVAL_PAGE;
	        }
	
	public abstract void  print(JspWriter out,String content) throws IOException;
}
